package cn.edu360t.beans

import org.apache.commons.lang.StringUtils

class RichString(val str: String) {
  def parseInt =
    try {
      if (StringUtils.isNotEmpty(str)) str.toInt else 0
    } catch {
      case _ =>0
    }
  def parseDouble =
    try {
      if (StringUtils.isNotEmpty(str)) str.toDouble else 0.0
    } catch {
      case _ =>0.0
    }
}
object RichString {
  implicit def str2RichString(str: String) = new RichString(str)
}

